<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="path" value="${pageContext.request.contextPath}" scope="application"></c:set>
<html>
<head>
    <title>z学生信息展示页</title>
</head>
<body>


<center><h1>学生信息列表</h1></center>

<a href="${path}/addStudent.jsp"><button>添加</button></a>
<table border="1px" cellspacing="0" width="100%">

    <tr>
        <th>序号</th>
        <th>学号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>生日</th>
        <th>操作</th>
    </tr>
<c:forEach items="${students}" var="student">
    <tr>
        <td>${student.id}</td>
        <td>${student.stuNo}</td>
        <td>${student.stuName}</td>
        <td>${student.stuAge}</td>
        <td>
            <fmt:formatDate value="${student.stuBirth}" pattern="yyyy-MM-dd"></fmt:formatDate>
        </td>
        <td>

            <a href="${path}/student?method=toUpdate&id=${student.id}"><button>修改</button></a>
            <a href="${path}/student?method=delete&id=${student.id}"><button>删除</button></a>

        </td>
    </tr>

</c:forEach>
    
</table>

<span style="color: red">${deleteInfo}</span>

</body>
</html>
